package com.lanyam.travel.base.service.impl;


import com.lanyam.travel.base.entity.GoodsImgs;
import com.lanyam.travel.base.entity.vo.GoodsImgsVo;
import com.lanyam.travel.base.dao.GoodsImgsMapper;
import com.lanyam.travel.base.service.IGoodsImgsService;
import org.springframework.transaction.annotation.Transactional;
import org.springframework.stereotype.Service;
import lombok.extern.slf4j.Slf4j;
import java.util.Map;
import javax.annotation.Resource;
import com.baomidou.mybatisplus.extension.plugins.pagination.Page;
import com.baomidou.mybatisplus.core.metadata.IPage;


@Service
@Transactional
@Slf4j
public class GoodsImgsServiceImpl implements IGoodsImgsService {

    @Resource
    private GoodsImgsMapper goodsImgsMapper;

    @Override
    public IPage<GoodsImgsVo> getPageGoodsImgs (Map<String, Object> queryMap, Integer page, Integer rows) {
        Page<GoodsImgsVo> pageSize = new Page<GoodsImgsVo>(page, rows);
        Page<GoodsImgsVo> pageInfo = goodsImgsMapper.getPage(pageSize, queryMap);
        return pageInfo;
    }

    @Override
    public void addGoodsImgs(GoodsImgs goodsImgs) {
        goodsImgsMapper.insert(goodsImgs);
    }

    @Override
    public void updateGoodsImgs(GoodsImgs goodsImgs) {
        goodsImgsMapper.updateById(goodsImgs);
    }

    @Override
    public void delById(String id) {
        goodsImgsMapper.delById(id);
    }
}